#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>

#include "interface.h"


int get_adc()
{
	unsigned int val;

	int fd = open("/dev/adc_dev_0", O_RDWR);
	if (fd == -1 ) {
		perror("open");
		printf("error: can't open file /dev/adc_dev0\n");
		return ;
	}
		ioctl(fd,ADC_L,&val);
		close(fd);	
	return val;
}
